import img from '@/assets/img/default_avatar.png'
export default {
    methods: {
        // 相当于全局定义了一个函数,showName
        logout() {
            sessionStorage.clear()
            this.$router.push({"name": "Login"})
        },
        getUserInfo() {
            let username = sessionStorage.getItem('username')
            let avatar = sessionStorage.getItem('avatar') ? sessionStorage.getItem('avatar') :img
            return {
                username, avatar
            }
        },
    }
}